import React from "react";
import {NavLink, Outlet, Route, Routes} from  "react-router-dom"

import News from "./News"

export default function Home() {
  return (
    <div>
      <nav>
        <NavLink to="news">News</NavLink>&nbsp;|&nbsp;
        <NavLink to="message">Message</NavLink>
      </nav>
      { 
      //<Outlet />
      // 嵌套路由的两种写法
      }
      <Routes>
        <Route path="news" element={<News />} />
      </Routes>
    </div>
  );
}
